package Evaluation;

import java.util.*;
import weka.core.*;

public class AttributeMap {
	/*String is the attribute name, Integer is the attribute index*/
	Map<String, Integer> m;
	
	AttributeMap(){
		m = new HashMap<String, Integer>();
	}
	
	public void constructMap(Instances instances){
		Enumeration<Attribute> e = instances.enumerateAttributes();
		while(e.hasMoreElements()){
			Attribute a = e.nextElement();
			String s = a.toString();
			String[] sArray = s.split(" ");
			int index = a.index();
			m.put(sArray[1], index);
			System.out.println(sArray[1]);
		}
		
	}
	
	public int getClusterAttIndex(){
		return m.get("Cluster");
	}
	
}

